import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/Home.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home,
        redirect: 'recommend',
        children: [
            {
                path: '/ranking',
                name: 'Ranking',
                component: () => import(/* webpackChunkName: "ranking" */ '../views/home/ranking/Ranking.vue')
            },
            {
                path: '/singer',
                name: 'Singer',
                component: () => import(/* webpackChunkName: "singer" */ '../views/home/singer/Singer.vue')
            },
            {
                path: '/recommend',
                name: 'Recommend',
                component: () => import(/* webpackChunkName: "recommend" */ '../views/home/recommend/Recommend.vue')
            },
            {
                path: '/search',
                name: 'Search',
                component: () => import(/* webpackChunkName: "search" */ '../views/home/search/Search.vue')
            },
        ]
    },
    {
        path: '*',
        name: '404',
        component: () => import(/* webpackChunkName: "404" */ '../views/404.vue')
    }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
